package com.netease.cloud.cm.demo.dependency.method;

import org.testng.annotations.Test;

/**
 * ===方法之间的依赖测试===
 *
 * 依赖一个不存在的方法时会报org.testng.TestNGException.
 */
public class MethodTest2 {

    @Test(dependsOnMethods = "test6")
    public void test1(){
        System.out.println("test1()");
    }

    @Test
    public void test2(){
        System.out.println("test2()");
    }

    @Test
    public void test3(){
        System.out.println("test3()");
    }

    @Test
    public void test4(){
        System.out.println("test4()");
    }
}

/**
 * org.testng.TestNGException:
 * com.netease.cloud.cm.demo.dependency.method.MethodTest2.test1() depends on nonexistent method test6
 * 	at org.testng.internal.MethodHelper.findDependedUponMethods(MethodHelper.java:114)
 * 	at org.testng.internal.MethodHelper.topologicalSort(MethodHelper.java:241)
 * 	at org.testng.internal.MethodHelper.sortMethods(MethodHelper.java:317)
 * 	at org.testng.internal.MethodHelper.collectAndOrderMethods(MethodHelper.java:64)
 * 	at org.testng.TestRunner.initMethods(TestRunner.java:438)
 * 	at org.testng.TestRunner.init(TestRunner.java:271)
 * 	at org.testng.TestRunner.init(TestRunner.java:241)
 * 	at org.testng.TestRunner.<init>(TestRunner.java:167)
 * 	at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:663)
 * 	at org.testng.SuiteRunner.init(SuiteRunner.java:260)
 * 	at org.testng.SuiteRunner.<init>(SuiteRunner.java:198)
 * 	at org.testng.TestNG.createSuiteRunner(TestNG.java:1271)
 * 	at org.testng.TestNG.createSuiteRunners(TestNG.java:1249)
 * 	at org.testng.TestNG.runSuitesLocally(TestNG.java:1107)
 * 	at org.testng.TestNG.runSuites(TestNG.java:1028)
 * 	at org.testng.TestNG.run(TestNG.java:996)
 * 	at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
 * 	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
 *
 * Process finished with exit code 0
 * Empty test suite.
 */
